﻿using CoachingOrganizer.ClientInfrastructure.ServicesEntities.LocalStorage.Tools.MoneyCalculation;
using CoachingOrganizer.Logic.Common;
using CoachingOrganizer.Logic.Logic.Common;
using CoachingOrganizer.Logic.Models.Tools.MoneyCalculation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CoachingOrganizer.Logic.Logic.Tools.MoneyCalculation
{
    internal class MoneyCalculationLogic : ToolLogicBase
    {
        private readonly MoneyCalculationModel _model;
        private readonly IMoneyCalculationInfo _localData;
        private readonly MoneyFlowLogic _incomes;
        private readonly MoneyFlowLogic _spents;
        private readonly ReportLogic _report;
        
        public MoneyCalculationModel Model
        {
            get { return _model; }
        }

        public IMoneyCalculationInfo LocalData
        {
            get { return _localData; }
        }

        public MoneyFlowLogic Incomes
        {
            get { return _incomes; }
        } 

        public MoneyFlowLogic Spents
        {
            get { return _spents; }
        } 

        public MoneyCalculationLogic(MoneyCalculationModel model, LogicExtender logicExtender, GoalLogic upperLogic, IMoneyCalculationInfo localData)
            : base(model, logicExtender, upperLogic, localData)
        {
            _model = model;
            _localData = localData;
            _incomes = new MoneyFlowLogic(model.Incomes, _logicExtender, this);
            _spents = new MoneyFlowLogic(model.Spents, _logicExtender, this);
            _report = new ReportLogic(model.Report, _logicExtender, this);
        }
    }
}
